import request from '@/utils/request'


export function getList(query) {
  return request({
    url: '/api/station/list',
    method: 'get',
    params: query
  })
}

export function all(query) {
  return request({
    url: '/api/distributors/all',
    method: 'get'
  })
}


export function selectCharge(distributor_id){
  return request({
    url: '/api/station/select_charge',
    method: 'get',
    params: {
      distributor_id:distributor_id
    }
  })
}

export function selectStation(distributor_id){
  return request({
    url: '/api/station/select_station',
    method: 'get',
    params: {
      distributor_id:distributor_id
    }
  })
}

export function getDistributor(station_id){
  return request({
    url: '/api/station/get_distributor',
    method: 'get',
    params: {
      station_id:station_id
    }
  })
}

export function create(data) {
  return request({
    url: '/api/station/create',
    method: 'post',
    data
  })
}

export function del(id) {
  return request({
    url: '/api/station/delete',
    method: 'get',
    params: { id }
  })
}

export function changeStatus(val, id) {
  return request({
    url: '/api/station/change_status',
    method: 'get',
    params: {
      id: id,
      status: val
    }
  })
}
